package com.kyc.kycxkplaygame.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import com.kyc.kycxkplaygame.R;
import com.kyc.kycxkplaygame.dbutils.GetPropLevelUtils;
import com.kyc.kycxkplaygame.greendao.manager.LevelInfoManager;

public class MySelfInfoActivity extends Activity {

    private TextView myself_nike;
    private TextView myself_passlevel;
    private TextView myself_passlevelcount;
    private TextView myself_countstart;
    private TextView myself_threestart;
    private TextView myself_twostart;
    private TextView myself_onestart;
    private TextView myself_putaoCount;
    private TextView myself_useputao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_self_info);
        Window window = getWindow();
        WindowManager.LayoutParams layoutParams = window.getAttributes();
        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
        layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
        layoutParams.alpha = 1f;
        window.setAttributes(layoutParams);
        findViewById(R.id.myself_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MySelfInfoActivity.this.finish();
            }
        });

        myself_nike = findViewById(R.id.myself_nike);
        myself_passlevel = findViewById(R.id.myself_passlevel);
        myself_passlevelcount = findViewById(R.id.myself_passlevelcount);
        myself_countstart = findViewById(R.id.myself_countstart);
        myself_threestart = findViewById(R.id.myself_threestart);
        myself_twostart = findViewById(R.id.myself_twostart);
        myself_onestart = findViewById(R.id.myself_onestart);
        myself_putaoCount = findViewById(R.id.myself_putaoCount);
        myself_useputao = findViewById(R.id.myself_useputao);

        myself_nike.setText(GetPropLevelUtils.getInstance().getUserName());
        myself_passlevel.setText("第"+GetPropLevelUtils.getInstance().getLevel()+"关");
        myself_passlevelcount.setText(LevelInfoManager.getInstance().getLevelInfoCount()+"关");
        myself_countstart.setText(LevelInfoManager.getInstance().getLevelCountStart()+"星");
        myself_threestart.setText(LevelInfoManager.getInstance().getLevelThreeStart()+"次");
        myself_twostart.setText(LevelInfoManager.getInstance().getLeveltwoStart()+"次");
        myself_onestart.setText(LevelInfoManager.getInstance().getLevelOneStart()+"次");
        myself_putaoCount.setText(GetPropLevelUtils.getInstance().getGrepCount()+"颗");
        myself_useputao.setText(GetPropLevelUtils.getInstance().getPropNum("葡萄")+"颗");
    }
}
